package com.zhike.utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: zhike
 * @CreateTime: 2024/5/1
 * @Description: 饼图工具类
 */
public class PieUtils {

    public static List<Map> getDeatail(List<Map> avgCountTypeToday, String dim, String field) {
        List<Map> maps = new ArrayList<>();
        if (!avgCountTypeToday.isEmpty()) {
            for (Map map : avgCountTypeToday) {
                Map data = new HashMap<>();
                data.put("name",map.get(dim).toString());
                data.put("value",map.get(field).toString());
                maps.add(data);
            }
        }
        return maps;
    }
}
